<?php

namespace App\Exceptions;

use Exception;
use Illuminate\Support\Arr;
use Throwable;

/**
 * Class ExpressQueryException
 * @package App\Exceptions
 */
class HttpException extends Exception
{
    public function __construct($code = 0, $message = '', Throwable $previous = null)
    {
        if(is_string($code)){
            $temp = $message;
            $message = $code;
            $code = $temp;
        }else{
            empty($message) && $message = Arr::get(config('error'),$code,'错误');
        }

        parent::__construct($message, $code, $previous);
    }
}
